#include "gpio/ADC_RT1064.h"


/**
 * @brief 
 *  0.Init
 *  1.sample
 *  2.convert
 *  3.getVoltage
 */

void ADC_RT1064::Init()
{
    ADC_DoAutoCalibration(base);
}

void ADC_RT1064::Sample()
{
    for(uint8_t i = 0;i<ChanelNum;i++)
		{
			ADC_SetChannelConfig(base,chanel_group,&channels_config[i]);
			while(0U==ADC_GetChannelStatusFlags(base,chanel_group))
			{
			}
			rawData[i] = ADC_GetChannelConversionValue(base,chanel_group);
		}
}
